package com.xbongbong.pro.businessrule.pojo;

import com.xbongbong.paas.constant.PaasConstant;
import com.xbongbong.paas.field.FieldAttrEntity;
import com.xbongbong.paas.field.FilterConditionsPoJo;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author 吴峰
 * @date 2020/10/10 11:12
 */
@Getter
@Setter
@ToString
public class BusinessRuleExplainPojo implements Serializable {

    private static final long serialVersionUID = 2053139504751440171L;
    /**
     * 当前子表单字段
     */
    private Map<String, FieldAttrEntity> thisSubExplainMap;

    /**
     * 目标子表单字段
     */
    private Map<String, FieldAttrEntity> targetSubExplainMap;

    /**
     * 条件为：目标表单子表单内字段等于当前表单子表单内字段
      */


    private  Boolean isSubFormAndSubForm;
    /**
     * 条件为：目标表单子表单内字段等于当前表单主字段
     */

    private Boolean isSubFormAndMain;
    /**
     * 条件为：目标表单表单主字段等于当前子表单内字段
     */
    private Boolean isMainAndSubForm;

    private String thisKey;

    private String targetKey;

    /**
     * 与子表单相关的条件
     */
    private List<FilterConditionsPoJo> subConditionsList;

    public BusinessRuleExplainPojo() {
        thisSubExplainMap = new HashMap<>(PaasConstant.DEFAULT_INITIAL_CAPACITY);
        targetSubExplainMap = new HashMap<>(PaasConstant.DEFAULT_INITIAL_CAPACITY);
        isSubFormAndSubForm = false;
        isSubFormAndMain = false;
        isMainAndSubForm = false;
    }

    public BusinessRuleExplainPojo(Map<String, FieldAttrEntity> thisSubExplainMap, Map<String, FieldAttrEntity> targetSubExplainMap, Boolean isSubFormAndSubForm,
                                   Boolean isSubFormAndMain, Boolean isMainAndSubForm, String thisKey, String targetKey) {
        this.thisSubExplainMap = thisSubExplainMap;
        this.targetSubExplainMap = targetSubExplainMap;
        this.isSubFormAndSubForm = isSubFormAndSubForm;
        this.isSubFormAndMain = isSubFormAndMain;
        this.isMainAndSubForm = isMainAndSubForm;
        this.thisKey = thisKey;
        this.targetKey = targetKey;
    }

    public BusinessRuleExplainPojo(Map<String, FieldAttrEntity> thisSubExplainMap, Map<String, FieldAttrEntity> targetSubExplainMap, boolean isSubFormAndSubForm, boolean isSubFormAndMain, boolean isMainAndSubForm, String thisKey, String targetKey, List<FilterConditionsPoJo> conditionsPoJoList) {
        this.thisSubExplainMap = thisSubExplainMap;
        this.targetSubExplainMap = targetSubExplainMap;
        this.isSubFormAndSubForm = isSubFormAndSubForm;
        this.isSubFormAndMain = isSubFormAndMain;
        this.isMainAndSubForm = isMainAndSubForm;
        this.thisKey = thisKey;
        this.targetKey = targetKey;
        this.subConditionsList = conditionsPoJoList;
    }
}
